home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Dylan Related / Mindy / Mindy 1.2 - portable sources / comp / compile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-15  |  2.5 KB  |  100 lines  |  [TEXT/ttxt]

  1. /**********************************************************************\
  2. *
  3. *  Copyright (c) 1994  Carnegie Mellon University
  4. *  All rights reserved.
  5. *  
  6. *  Use and copying of this software and preparation of derivative
  7. *  works based on this software are permitted, including commercial
  8. *  use, provided that the following conditions are observed:
  9. *  
  10. *  1. This copyright notice must be retained in full on any copies
  11. *     and on appropriate parts of any derivative works.
  12. *  2. Documentation (paper or online) accompanying any system that
  13. *     incorporates this software, or any part of it, must acknowledge
  14. *     the contribution of the Gwydion Project at Carnegie Mellon
  15. *     University.
  16. *  
  17. *  This software is made available "as is".  Neither the authors nor
  18. *  Carnegie Mellon University make any warranty about the software,
  19. *  its performance, or its conformity to any specification.
  20. *  
  21. *  Bug reports, questions, comments, and suggestions should be sent by
  22. *  E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  23. *
  24. ***********************************************************************
  25. *
  26. * $Header: compile.h,v 1.5 94/10/05 20:54:20 nkramer Exp $
  27. *
  28. \**********************************************************************/
  29.  
  30.  
  31.  
  32. struct block {
  33.     struct block *next;
  34.     unsigned char *end;
  35.     unsigned char bytes[1];
  36. };
  37.  
  38. struct debug_info {
  39.     int line;
  40.     int bytes;
  41.     struct scope_info *scope;
  42.     struct debug_info *next;
  43. };
  44.  
  45. struct var_info {
  46.     struct id *var;
  47.     boolean indirect;
  48.     boolean argument;
  49.     int offset;
  50.     struct var_info *next;
  51. };
  52.  
  53. struct scope_info {
  54.     int handle;
  55.     int nvars;
  56.     struct var_info *vars;
  57.     struct var_info **vars_tail;
  58.     struct scope_info *outer;
  59. };
  60.  
  61. struct component {
  62.     struct literal *debug_name;
  63.     int frame_size;
  64.     int cur_line;
  65.     struct scope_info *cur_scope;
  66.     int cur_line_start;
  67.     int ndebug_infos;
  68.     struct debug_info *debug_info;
  69.     struct debug_info **debug_info_tail;
  70.     int nconstants;
  71.     struct constant *constants;
  72.     struct constant **constants_tail;
  73.     int bytes;
  74.     struct block *blocks;
  75.     struct block *cur_block;
  76.     unsigned char *fill;
  77.     unsigned char *end;
  78. };
  79.  
  80. enum constant_kind {
  81.     constant_LITERAL, constant_METHODDESC, constant_VARREF
  82. };
  83.  
  84. struct constant {
  85.     enum constant_kind kind;
  86.     struct constant *next;
  87.     union {
  88.     struct literal *literal;
  89.     struct method *method;
  90.     struct {
  91.         struct id *id;
  92.         boolean written;
  93.     } varref;
  94.     } u;
  95. };
  96.  
  97. extern void compile(struct body *program);
  98.  
  99. extern void init_compile(void);
  100.